package com.zsrt.java.day20161229.cg.practice.demo03;

import java.util.Scanner;

public class Tax {
	public static void main(String[] args) {

		double salary;//方法里面的变量 是局部变量 这个是薪水
		double baseTax;//起征点
		double left; //需要缴税的工资
		double tax; //应缴个税
		Scanner s = new Scanner(System.in);
		System.out.println("输入你的月薪");
		salary = s.nextDouble();
		
		System.out.println("输入你的起征点");
		baseTax = s.nextDouble();
		s.close();
		
		left = salary - baseTax;
		
		if(left <= 0){
			tax = 0;
			System.out.println("你不需要缴税，再努力吧！");
		}else if(left <= 1500){
			tax = left*0.03 - 0;
		}else if(left <= 4500){
			tax = left*0.1 - 105;
		}else if(left <= 9000){
			tax = left*0.2 - 555;
		}else if(left <= 35000){
			tax = left*0.3 - 1005;
		}else if(left <=80000){
			tax = left*0.35 - 5505;
		}else{
			tax = left*0.45 - 13505;
		}
		
		System.out.println("你需要交的税额： "+tax);
	}
}
